package com.xiebang.extenddemo;

/**
 * Created by xiebang
 * Description
 * User:小谢
 * Date:2021-09-10
 * Time:16:52
 */
class Animal{
    public String name;
    public int age;
    public void eat(){
        System.out.println(name + ":吃饭饭！");
    }
    public void bark(){
        System.out.println(name + ": 叫！！！");
    }
}
class Cat extends Animal{
public void upTree(){
    System.out.println(name + ":上树！");
}
}

class Dog extends Animal{
       public String color;
}
//class Cat{
//    public String name;
//    public int age;
//    public void eat(){
//        System.out.println("吃饭饭！");
//    }
//    public void bark(){
//        System.out.println("叫！！！");
//    }
//    public void upTree(){
//        System.out.println("上树！");
//    }
//}
//
//class Dog{
//    public String name;
//    public int age;
//    public void eat(){
//        System.out.println("吃饭饭！");
//    }
//    public void bark(){
//        System.out.println("叫！！！");
//    }
//}
public class Test {
    public static void main(String[] args) {
        Cat cat = new Cat();
        cat.name = "mimi";
        cat.upTree();
    }
    public static void main1(String[] args) {
        Dog dog = new Dog();
        dog.name = "wangwang";
        dog.bark();
        dog.eat();
    }
}
